/**
 * <copyright>
 * </copyright>
 *

 */
package org.xtext.tcc.tccdsl.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EFactoryImpl;

import org.eclipse.emf.ecore.plugin.EcorePlugin;

import org.xtext.tcc.tccdsl.Attribute;
import org.xtext.tcc.tccdsl.Entity;
import org.xtext.tcc.tccdsl.Function;
import org.xtext.tcc.tccdsl.Model;
import org.xtext.tcc.tccdsl.TccdslFactory;
import org.xtext.tcc.tccdsl.TccdslPackage;
import org.xtext.tcc.tccdsl.Type;
import org.xtext.tcc.tccdsl.TypeDef;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class TccdslFactoryImpl extends EFactoryImpl implements TccdslFactory
{
  /**
   * Creates the default factory implementation.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public static TccdslFactory init()
  {
    try
    {
      TccdslFactory theTccdslFactory = (TccdslFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.xtext.org/tcc/Tccdsl"); 
      if (theTccdslFactory != null)
      {
        return theTccdslFactory;
      }
    }
    catch (Exception exception)
    {
      EcorePlugin.INSTANCE.log(exception);
    }
    return new TccdslFactoryImpl();
  }

  /**
   * Creates an instance of the factory.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TccdslFactoryImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public EObject create(EClass eClass)
  {
    switch (eClass.getClassifierID())
    {
      case TccdslPackage.MODEL: return createModel();
      case TccdslPackage.TYPE: return createType();
      case TccdslPackage.PACKAGE: return createPackage();
      case TccdslPackage.TYPE_DEF: return createTypeDef();
      case TccdslPackage.ENTITY: return createEntity();
      case TccdslPackage.ATTRIBUTE: return createAttribute();
      case TccdslPackage.FUNCTION: return createFunction();
      default:
        throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
    }
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Model createModel()
  {
    ModelImpl model = new ModelImpl();
    return model;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Type createType()
  {
    TypeImpl type = new TypeImpl();
    return type;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public org.xtext.tcc.tccdsl.Package createPackage()
  {
    PackageImpl package_ = new PackageImpl();
    return package_;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TypeDef createTypeDef()
  {
    TypeDefImpl typeDef = new TypeDefImpl();
    return typeDef;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Entity createEntity()
  {
    EntityImpl entity = new EntityImpl();
    return entity;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Attribute createAttribute()
  {
    AttributeImpl attribute = new AttributeImpl();
    return attribute;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Function createFunction()
  {
    FunctionImpl function = new FunctionImpl();
    return function;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public TccdslPackage getTccdslPackage()
  {
    return (TccdslPackage)getEPackage();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @deprecated
   * @generated
   */
  @Deprecated
  public static TccdslPackage getPackage()
  {
    return TccdslPackage.eINSTANCE;
  }

} //TccdslFactoryImpl
